package day01;

public class ArrayUtilTest {
    public static void main(String[] args) {
        int[] test = new int[]{1,5,10,20,33,99,90,87,56,34,12,43};
        ArrayUtil a = new ArrayUtil();

        int max = a.getMax(test);//获取最大值
        int min = a.getMix(test);//获取最小值
        int sum = a.getSum(test);//获取总和
        int avg = a.getAverage(test);//获取平均值
        System.out.println("最大值为：" + max);
        System.out.println("最小值为：" + min);
        System.out.println("总和为：" + sum);
        System.out.println("平均数为：" + avg);
        a.print(test);//遍历数组

        System.out.println("*************************");
        System.out.println("反转数组");
        a.reverse(test);//反转数组
        a.print(test);//遍历数组
        System.out.println("*************************");
        System.out.println("从大到小排序");
        a.sortMaxtoMin(test);//从大到小排序
        a.print(test);//遍历数组

        System.out.println("*************************");
        System.out.println("从小到大排序");
        a.sortMintoMax(test);//从小到大排序
        a.print(test);//遍历数组


    }
}
